package com.yy.wga.goods.service.api.response.product;

import com.alibaba.fastjson.annotation.JSONField;
import com.yy.wga.goods.service.api.response.BaseApiDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class PromoteProductDetailDTO extends BaseApiDTO implements Serializable {

    @JSONField(name = "product")
    private Product product;


    @Data
    public static class Product {
        /**
         * 所属店铺ID
         */
        @JSONField(name = "shop_appid")
        private String shopAppid;

        /**
         * 商品ID
         */
        @JSONField(name = "product_id")
        private String productId;

        /**
         * 商品数据
         */
        @JSONField(name = "product_info")
        private ProductInfo productInfo;

        /**
         * 佣金信息
         */
        @JSONField(name = "commission_info")
        private CommissionInfo commissionInfo;

        /**
         * 商品维度保障数据
         */
        @JSONField(name = "extra_service")
        private ExtraService extraService;

        /**
         * 商品维度统计数据
         */
        @JSONField(name = "statistical_data")
        private StatisticalData statisticalData;



    }

    @Data
    public static class ProductInfo {
        /**
         * 商品标题
         */
        @JSONField(name = "title")
        private String title;

        /**
         * 商品子标题
         */
        @JSONField(name = "sub_title")
        private String subTitle;

        /**
         * 商品头图URL列表
         */
        @JSONField(name = "head_imgs")
        private List<String> headImgs;


        /**
         * 产品描述信息
         */
        @JSONField(name = "desc_info")
        private DescInfo descInfo;

        /**
         * 产品分类信息
         */
        @JSONField(name = "cats_v2")
        private List<Cat> catsV2;

        /**
         * 配送信息
         */
        @JSONField(name = "express_info")
        private ExpressInfo expressInfo;


        @JSONField(name = "skus")
        private List<Sku> skus;

        @JSONField(name = "product_promotion_link")
        private String productPromotionLink;
    }

    @Data
    public static class DescInfo {
        /**
         * 产品描述图片URL
         */
        @JSONField(name = "imgs")
        private List<String> imgs;

        /**
         * 产品描述
         */
        @JSONField(name = "desc")
        private String desc;
    }

    @Data
    public static class Cat {
        /**
         * 分类ID
         */
        @JSONField(name = "cat_id")
        private String catId;

    }

    @Data
    public static class ExpressInfo {

        /**
         * 发货时间
         */
        @JSONField(name = "send_time")
        private String sendTime;

        /**
         * 地址信息
         */
        @JSONField(name = "address_info")
        private AddressInfo addressInfo;

        /**
         * 配送方式， NOT_FREE 不免邮
         */
        @JSONField(name = "shippping_method")
        private String shipppingMethod;
    }

    @Data
    public static class AddressInfo {
        @JSONField(name = "postal_code")
        private String postalCode;

        @JSONField(name = "province_name")
        private String provinceName;

        @JSONField(name = "city_name")
        private String cityName;

        @JSONField(name = "county_name")
        private String countyName;
    }

    @Data
    public static class ExtraService {
        /**
         * 是否支持七天无理由退货，0-不支持七天无理由，1-支持七天无理由，2-支持七天无理由(定制商品除外)，3-支持七天无理由(使用后不支持)。
         */
        @JSONField(name = "seven_day_return")
        private Integer sevenDayReturn;

        /**
         * 先用后付，0-不支持先用后付，1-支持先用后付。
         */
        @JSONField(name = "pay_after_use")
        private Integer payAfterUse;

        /**
         * 是否支持运费险，0-不支持运费险，1-支持运费险。
         */
        @JSONField(name = "freight_insurance")
        private Integer freightInsurance;

        /**
         * 是否支持假一赔三，0-不支持假一赔三，1-支持假一赔三。
         */
        @JSONField(name = "fake_one_pay_three")
        private Integer fakeOnePayThree;

        /**
         * 是否支持坏损包退，0-不支持坏损包退，1-支持坏损包退，
         */
        @JSONField(name = "damage_guarantee")
        private Integer damageGuarantee;
    }


    @Data
    public static class StatisticalData {
        /**
         * 好评率【10000表示好评率100%】
         */
        @JSONField(name = "good_ratio")
        private Integer goodRatio;

        /**
         * 最近30天销量
         */
        @JSONField(name = "sales_in_30_days")
        private Integer salesIn30Days;
    }

    @Data
    public static class Sku {
        @JSONField(name = "sku_id")
        private String skuId;

        @JSONField(name = "thumb_img")
        private String thumbImg;

        @JSONField(name = "sale_price")
        private Integer salePrice;

        @JSONField(name = "stock_num")
        private Integer stockNum;

        @JSONField(name = "sku_attrs")
        private List<Attr> skuAttrs;
    }

    @Data
    public static class Attr {
        @JSONField(name = "attr_key")
        private String attrKey;

        @JSONField(name = "attr_value")
        private String attrValue;
    }

    @Data
    public static class CommissionInfo {
        /**
         * 佣金状态
         */
        @JSONField(name = "status")
        private Integer status;

        /**
         * 服务比例
         */
        @JSONField(name = "service_ratio")
        private Integer serviceRatio;

        /**
         * 佣金比例
         */
        @JSONField(name = "ratio")
        private Integer ratio;

        /**
         * 开始时间
         */
        @JSONField(name = "start_time")
        private long startTime;

        /**
         * 结束时间
         */
        @JSONField(name = "end_time")
        private long endTime;

        /**
         * 店铺普通佣金计划信息
         */
        @JSONField(name = "normal_commission_info")
        private NormalCommissionInfo normalCommissionInfo;

    }

    @Data
    public static class NormalCommissionInfo {
        /**
         * 佣金比例
         */
        @JSONField(name = "ratio")
        private Integer ratio;
    }
}
